package com.xyy.saas.payment.service.impl;

import com.xyy.saas.payment.dao.mapper.BusinessRecordMapper;
import com.xyy.saas.payment.dao.model.BusinessRecordPo;
import com.xyy.saas.payment.service.BusinessRecordService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.Date;
import java.util.List;

/**
 * @Author zhangwenxiong
 * @Date 2020/12/29 11:22
 * @Version 1.0
 */
@Service
public class BusinessRecordServiceImpl implements BusinessRecordService {

    @Autowired
    private BusinessRecordMapper businessRecordMapper;

    @Override
    public BusinessRecordPo getByNo(BusinessRecordPo businessRecordPo) {
        return businessRecordMapper.getByNo(businessRecordPo);
    }

    @Override
    public void addRecord(BusinessRecordPo businessRecordPo) {
        businessRecordMapper.addRecord(businessRecordPo);
    }

    @Override
    public void updateRecord(BusinessRecordPo businessRecordPo) {
        businessRecordMapper.updateRecord(businessRecordPo);
    }

    @Override
    public List<BusinessRecordPo> queryBusinessRecordPoByStatus(String status, Date beginTime, Date endTime, int page, int pageSize){
       return businessRecordMapper.queryByStatus(status, beginTime, endTime, page, pageSize);
    }

    @Override
    public Integer countBusinessRecordPoByStatus(String status, Date beginTime, Date endTime){
       return businessRecordMapper.countByStatus(status, beginTime, endTime);
    }

    @Override
    public void updateRecordsStatus(List<BusinessRecordPo> businessRecordPos) {
        businessRecordMapper.updateRecordsStatus(businessRecordPos);
    }

    @Override
    public BusinessRecordPo isRepeate(BusinessRecordPo businessRecordPo) {
        BusinessRecordPo exite = businessRecordMapper.getByNo(businessRecordPo);
        return exite;
    }
}
